import { SEntityInfo } from "../../../../../Message/BroadCast/SEntityInfo";
import { SPetInfo } from "../../../../../Message/Game/SPetInfo";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { PetEventName } from "../../pet/PetEventName";
import { FeedType } from "../../pet/FeedType";
import { PetColor } from "../../pet/info/PetColor";
import { PetDelAlertWindow } from "../../pet/PetDelAlertWindow";
import { EPlayerItemPosType } from "../../../../../Message/Public/EPlayerItemPosType";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { Energy } from "../../../../../FeedType/Energy";
//class PetOpMenuConst
    
    export  class PetOpMenuConst
    {
        

        public static Opearte(arg1: string, arg2: SEntityInfo, arg3: SPetInfo): void
        {
            var loc1="";
            var loc2=arg1;
            switch (loc2) 
            {
                case PetOpMenuConst.LookInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetViewInfo, arg2.entityId));
                    break;
                }
                case PetOpMenuConst.Rest:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetRest));
                    break;
                }
                case PetOpMenuConst.AddEnergy:
                {
                    Dispatcher.dispatchEvent(new DataEvent(PetEventName.PetFeedClick, {"petInfo": arg3, "feedType": Energy}));
                    break;
                }
                case PetOpMenuConst.LookOver:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetMeetLookOverPlayerPet, {"playerId": arg2.entityId.id, "petUid": arg3.uid}));
                    break;
                }
                case PetOpMenuConst.Close:
                {
                    break;
                }
                case PetOpMenuConst.Delete:
                {
                    if (PetColor.isAbovePurple(arg3.talent)) 
                    {
                        PetDelAlertWindow.instance.mode = PetDelAlertWindow.ValidateMode;
                    }
                    else 
                    {
                        PetDelAlertWindow.instance.mode = PetDelAlertWindow.NormalMode;
                    }
                    PetDelAlertWindow.instance.posType = EPlayerItemPosType._EPlayerItemPosTypePetWarehouse;
                    PetDelAlertWindow.instance.petInfo = arg3;
                    PetDelAlertWindow.instance.show();
                    break;
                }
                case PetOpMenuConst.LoookUp:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetWareHouse_LookUpPet, arg3.uid));
                    break;
                }
            }
            return;
        }

        
        {
            PetOpMenuConst.AimAvatarOpMenu = new DataProvider([{"label": PetOpMenuConst.LookInfo, "enabled": true}]);
            PetOpMenuConst.AvatarOpMenu = new DataProvider([{"label": PetOpMenuConst.Rest, "enabled": true}, {"label": PetOpMenuConst.AddEnergy, "enabled": true}]);
            PetOpMenuConst.RankOpMenu = new DataProvider([{"label": PetOpMenuConst.LookOver, "enabled": true}]);
            PetOpMenuConst.PetWarehouseOpMenu = new DataProvider([{"label": PetOpMenuConst.LoookUp, "enabled": true}, {"label": PetOpMenuConst.Delete, "enabled": true}]);
        }

        public static /* const */LookInfo: string="   查看资料";

        public static /* const */Rest: string="   休    息";

        public static /* const */AddEnergy: string="   补充精力";

        public static /* const */Close: string="   关    闭";

        public static /* const */LookOver: string="   宠物展示";

        public static /* const */Delete: string="   放    生";

        public static /* const */LoookUp: string="   查    看";

        public static /* var */AimAvatarOpMenu: DataProvider;

        public static /* var */AvatarOpMenu: DataProvider;

        public static /* var */RankOpMenu: DataProvider;

        public static /* var */PetWarehouseOpMenu: DataProvider;
    }
